<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<App />
		</div>
		<script src="../node_modules/vue/dist/vue.js"></script>
		<script src="../node_modules/axios/dist/axios.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			let App = {
				template:`
				<div>
					<button @click="sendAjax">点击发送请求</button>
				</div>
				`,
				methods: {
					sendAjax(){
						let param = {
							params: {
								name: 'zqf',
								age: 22,
							}
						}
						this.$axios.get('getData.json', param).then(res => {
							console.log(res)
						}).catch(err => {
							
						})
					}
				}
			}
			
			//挂载axios
			Vue.prototype.$axios = axios
			let vm = new Vue({
				el: '#app',
				components: {App},
				data(){
					return {
						
					}
				},
			})
		</script>
	</body>
</html>
